package com.zhss.springbootdemo01.dao;

import com.zhss.springbootdemo01.domain.User;
import com.zhss.springbootdemo01.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName UserDAOImpl
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2021/2/6 18:09
 * @Version 1.0
 */
@Repository
public class UserDAOImpl implements UserDAO {


	@Autowired
 	private UserMapper userMapper;

	@Override
	public List<User> listUsers() {
		return userMapper.listUser();
	}

	@Override
	public User getUserById(Long userId) {
		return userMapper.getUserById(userId);
	}

	@Override
	public void saveUser(User user) {
		userMapper.saveUser(user);
	}

	@Override
	public void updateUser(User user) {
		userMapper.updateUser(user);
	}

	@Override
	public void removeUser(Long userId) {
		userMapper.removeUser(userId);
	}
}
